<?php

require_once 'Oos.php';

$oos = new Oos("http://localhost/api/v1");
#$oos->setCredentials("luis@11870.com", "xx");
$oos->setApiKey("peralta","xx");
$sites = $oos->sites();


$feed = $sites->getSiteFeed('peralta');

function getNextPage($sites, $feed) {
    $nextURL = $feed->getLink('next')->href;

    if ($nextURL !== null) {
        return $sites->getSiteFeed($nextURL);
    } else {
        return null;
    }
}

do {
	foreach ($feed as $entry) {
  		echo 'Title: ' . $entry->title->text . "\n";
  		echo 'ReviewTitle: ' . $entry->getReviewTitle() . "\n";
	}
} while (($feed = getNextPage($sites, $feed)) != null);

?>